const router = require("koa-router")()
const banner = require("../data/banner")
const top = require("../data/top250")
router.get("/api/subject",async ctx=>{
    console.log(ctx.request.query);
    var {id} = ctx.request.query
    var item = top.find(item=>{
        return item._id == id
    })
    console.log(item);
    ctx.body = item
})
router.get("/api/top250", async ctx=>{
    ctx.body = top
})
router.get("/api/banner",async ctx=>{
    ctx.body = banner
})
module.exports = router